package com.jwaoo.chat.session.actions;

import com.jwaoo.chat.ChatConstants;
import com.jwaoo.chat.Message;
import com.jwaoo.chat.R;
import com.jwaoo.chat.attachment.FileAttachment;
import com.jwaoo.chat.data.db.MessageHandler;
import com.jwaoo.chat.extension.SnapChatAttachment;

import java.io.File;
import java.util.logging.Handler;

/**
 * Created by zhoujianghua on 2015/7/31.
 */
public class SnapChatAction extends PickImageAction {

    public SnapChatAction() {
        super(R.drawable.message_plus_snapchat_selector, R.string.input_panel_snapchat, false);
    }

    @Override
    protected void onPicked(File file) {

        FileAttachment snapChatAttachment = new FileAttachment();
        snapChatAttachment.setPath(file.getPath());
        snapChatAttachment.setSize(file.length());
//        CustomMessageConfig config = new CustomMessageConfig();
//        config.enableHistory = false;
//        config.enableRoaming = false;
//        config.enableSelfSync = false;
        Message message = MessageHandler.getInstace(getActivity().getApplicationContext()).createMessage(ChatConstants.snap,getContainer().account,snapChatAttachment);
        sendMessage(message);
    }

}
